package com.solidumgame.martillo.health
{
	import com.pblabs.components.basic.HealthComponent;
	import com.pblabs.engine.PBE;
	import com.pblabs.engine.entity.IEntity;

	public class Health
	{	
		private var logic:HealthLogicComponent;
		private var render:HealthRendererComponent;
		private var myEntity:IEntity;
		public function Health()
		{
			logic = new HealthLogicComponent();
			render = new HealthRendererComponent();
			myEntity = PBE.allocateEntity();
			myEntity.addComponent(logic, "Logic");
			myEntity.addComponent(render, "Renderer");
			myEntity.initialize("Health");
		}
		
		public function remove():void{
			myEntity.destroy();
			myEntity = null;
			logic = null;
			render = null;
			
		}
	}
}